class Solution
{
public:
    vector<int> sumZero(int n)
    {
        if (n == 2)
        {
            return {-1, 1};
        }
        int i = 0;
        vector<int> result;
        while (i < n - 1)
        {
            result.push_back(i);
            ++i;
        }
        result.push_back(-i * (i - 1) / 2);
        return result;
    }
};